#! /bin/sh

OPTIONS="-o softvol -M HiFiBerry -N /var/squeezelite/squeezelite.name -z"

case "$1" in
    start)
	printf "Starting SqueezeLite: "
	start-stop-daemon -S -q --exec /usr/bin/squeezelite -- $OPTIONS
	[ $? = 0 ] && echo "OK" || echo "FAIL"
	;;
    stop)
	printf "Stopping SqueezeLite: "
	start-stop-daemon -K -x /usr/bin/squeezelite
	[ $? = 0 ] && echo "OK" || echo "FAIL"
	;;
    restart)
	$0 stop
	$0 start
	;;
    *)
	echo "Usage: $0 {start|stop|restart}"
	exit 1
	;;
esac
